// 封装文章管理相关请求

// 导入instance
import { instance } from "@/utils/request";


// 获取文章列表
export const getArticleListAPI = (articleQuery) => {
    return instance({
        method: "get",
        url: "/article",
        params: articleQuery
    })
}

// 删除文章
export const delArticleAPI = (articleId) => {
    instance({
        method: "delete",
        url: `/article/${articleId}`
    })
}

// 获取文章详情
export const getArticleDetailAPI = (articleId) => {
    return instance({
        method: "get",
        url: `/article/${articleId}`
    })
}

// 新增文章
export const addArticleAPI = (articleForm) => {
    instance({
        method: "post",
        url: "/article",
        data: articleForm
    })
}

// 编辑文章
export const editArticleAPI = (articleForm) => {
    instance({
        method: "put",
        url: `/article/${articleForm.id}`,
        data: articleForm
    })
}


